package com.fzy.designpattern.iterator;

import java.util.ArrayList;

public class ConcreteAggregate implements Aggregate {

    private ArrayList<Object> list = new ArrayList<>();

    @Override
    public void add(Object o) {
        this.list.add(o);
    }

    @Override
    public void remove(Object o) {
        this.list.remove(o);
    }

    @Override
    public Iterator iterator() {
        return new ConcreteIterator(this.list);
    }

}
